import request from '/@/api/request'
/** 数据产品列表-分页 */
export const getDataProductList = (data: DataProductTypes.IRequest) => {
  return request.post<IPaginationResponse<DataProductTypes.IResponse[]>>('/business/datamarket/dataProduct/list', data)
}

/** 数据产品详情 */
export const getDataProductById = (data: DataProductTypes.DetailIRequest) => {
  return request.get<IBaseResponse<DataProductTypes.DetailIResponse>>('/business/datamarket/dataProduct/getDataProductById', data)
}

/** 数据产品操作记录 */
export const getDataProductActionRecord = (data: DataProductTypes.DetailIRequest) => {
  return request.post<IPaginationResponse<DataProductTypes.ActionRecordIResponse[]>>('/business/datamarket/dataProduct/operationLogs', data)
}

/** 数据产品审核记录 */
export const getResourceApproveList = (data: DataProductTypes.DetailIRequest) => {
  return request.post<IPaginationResponse<DataProductTypes.AuditRecordIResponse[]>>('/business/datamarket/resourceApprove/resourceApproveList', data)
}

/** 数据产品-保存 */
export const saveDataProduct = (data: DataProductTypes.SaveRequest) => {
  return request.post<IPaginationResponse<string>>('/business/datamarket/dataProduct/saveDataProductWeb', data)
}

/** 数据产品上架、下架  */
export const changeStatusDataProduct = (data: DataProductTypes.ChangeStatusIRequest) => {
  return request.post<IPaginationResponse<string>>('/business/datamarket/dataProduct/changeStatus', data)
}

/** 数据产品审核 */
export const approveDataProduct = (data: DataProductTypes.ApproveRequest) => {
  return request.post<IPaginationResponse<string>>('/business/datamarket/dataProduct/dataProductApprove', data)
}
